﻿@model  WaiGaoQiaoWeb.Models.Con_GoodsVM
@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";    
}
@section Head
{
    @Html.Css("form", "validationEngine")
    @Html.Js("form", "validate", "unobtrusive", "inlinevalidation")
    <script type="text/javascript">
        $(document).ready(function () {
            $("form").makeValidationInline();
            //保存
            $("#btnSave").click(function (event) {
                //if (!$("#GoodsEdit").valid()) {
                //     return false;
                // }
                $('#GoodsEdit').ajaxSubmit(function (callback) {
                    if (callback) {
                        CloseModelWindow(null, true);
                    }
                    else {
                        showErrorTip("操作失败！", { left: 200, top: 2 }, true, 5000);
                    }
                });

            });
            //关闭
            $("#btnCancel").click(function (e) {
                //var users = "我来自上一页，请多关照！";
                CloseModelWindow(null, false);
            });

        })
    </script>
}
<div style="padding: 5px;">
    @using (Html.BeginForm("SaveGoods", "Con_Goods", FormMethod.Post, new { id = "GoodsEdit" }))
    {
        @Html.ValidationSummary(true)
        <div class="mainpanel">
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.GoodsNo):
                @Html.TextBoxFor(model => model.GoodsNo, new { @class = "" })<b style="color: Red">*</b>
                @Html.ValidationMessageFor(model => model.GoodsNo)
            </div>
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.GoodsName):
                @Html.TextBoxFor(model => model.GoodsName, new { @class = "" }) <b style="color: Red">
                    *</b>
                @Html.ValidationMessageFor(model => model.GoodsName)
            </div>
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.GoodsUnit):
                @Html.TextBoxFor(model => model.GoodsUnit, new { @class = "" })
            </div>
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.Type):
                @Html.DropDownListFor(model => model.Type, ViewData["Type"] as IEnumerable<SelectListItem>,
                                 new { @style = "width:150px; height:22px; font-size:13px;" })
            </div>
        </div>
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.PriorID)
    }
    <div class="buttonpanel">
        <div style="float: right; margin-right: 10px;">
            <a id="btnSave" class="button" href="javascript:void(0);"><span>保存</span></a> <a
                id="btnCancel" class="button" href="javascript:void(0);"><span>关闭</span></a>
        </div>
    </div>
</div>
